home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / symbol.h < prev    next >
C/C++ Source or Header  |  1996-01-30  |  3KB  |  84 lines

  1. /*
  2.  * Copyright (C) 1985-1992  New York University
  3.  * 
  4.  * This file is part of the Ada/Ed-C system.  See the Ada/Ed README file for
  5.  * warranty (none) and distribution info and also the GNU General Public
  6.  * License for more details.
  7.  
  8.  */
  9. #ifndef _symbol_h
  10. #define _symbol_h
  11. #include "set.h"
  12.  
  13. typedef struct Symbol_s *Symbol;
  14.  
  15. typedef struct Symbol_s
  16. {
  17.     short        nature;        /* one of na_ codes */
  18.     short        s_seq;    /* sequence number within unit */
  19.     short        s_unit; /* unit number */
  20.     short        type_attr;    /* miscellaneous type attributes */
  21.     Symbol        type_of;    /* type */    
  22.     Symbol        scope_of;    /* scope: symbol table pointer */
  23.     Tuple        signature;    /* pointer to tuple, varies by NATURE */
  24.     Set        overloads;
  25.     Declaredmap    declared;
  26.     Symbol        alias;
  27.     char        *orig_name;
  28.     char        *misc;
  29.     /* remaining fields used only by generator */
  30.     /* we use short intending 16 bits */
  31.     short        type_kind;
  32.     short        type_size;
  33.     Symbol        init_proc;
  34.     Tuple        associated_symbols;  /* for _type, etc */
  35.     short        s_segment; /* REFERENCE_MAP segment */
  36.     short        s_offset; /* REFERENCE_MAP offset */
  37.     Tuple       rcinfo;
  38.     Tuple       repr;
  39.     short       forced;
  40.  
  41. } Symbol_s;
  42.  
  43. /* s_offset was originally unsigned. However, processing of variant
  44.  * records currently requires that it be signed. Also, since currently
  45.  * using words as basic storage unit,there is no great loss in making it
  46.  * signed.    ds    11-18-85
  47.  */
  48. /*
  49. The nature field gives the kind of the entry, i.e., it serves as a
  50. discriminant. The type_of field is a pointer to a symbol entry giving
  51. the type. 
  52. In the SETL source, the field names correspond to maps and are
  53. often referenced in form
  54.     NATURE(x)   TYPE_OF(x)     etc
  55. We require that such usage use upper case and define macros to
  56. avoid the need to translate all such instances. Note however that
  57. instances of lower-case names for fields will have to be translated
  58.     nature(x) -> NATURE(x)
  59. */
  60.  
  61. #define NATURE(x)    ((x)->nature)
  62. #define TYPE_OF(x)    ((x)->type_of)
  63. #define ALIAS(x)    ((x)->alias)
  64. #define SIGNATURE(x)    ((x)->signature)
  65. #define SCOPE_OF(x)    ((x)->scope_of)
  66. #define OVERLOADS(x)    ((x)->overloads)
  67. #define DECLARED(x)    ((x)->declared)
  68. #define ORIG_NAME(x)    ((x)->orig_name)
  69. #define S_SEQ(x)    ((x)->s_seq)
  70. #define S_UNIT(x)    ((x)->s_unit)
  71. #define TYPE_ATTR(x)    ((x)->type_attr)
  72. #define MISC(x)        ((x)->misc)
  73. #define TYPE_KIND(x)    ((x)->type_kind)
  74. #define TYPE_SIZE(x)    ((x)->type_size)
  75. #define INIT_PROC(x)    ((x)->init_proc)
  76. #define ASSOCIATED_SYMBOLS(x) ((x)->associated_symbols)
  77. #define S_SEGMENT(x) ((x)->s_segment)
  78. #define S_OFFSET(x) ((x)->s_offset)
  79. #define RCINFO(x) ((x)->rcinfo)
  80. #define FORCED(x) ((x)->forced)
  81. #define REPR(x) ((x)->repr)
  82.  
  83. #endif
  84.